package org.masterview.user.client.validation;

public class RegexpValidator implements Validator
{
    protected String regexp;

    public String getRegexp() {
        return regexp;
    }

    public void setRegexp(String regexp) {
        this.regexp = regexp;
    }

    public RegexpValidator(String regexp) {
        this.regexp = regexp;
    }

    public boolean isValid(Object object) {
        String s = object.toString();
        return s.matches(regexp);
    }
}
